﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
	mc:Ignorable="d" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
	xmlns:n="http://nRoute/schemas/2010/xaml"
	x:Class="nRoute.Samples.OfficerXcel.Views.OptionsDialog" d:DesignHeight="680">
	
	<UserControl.Resources>
		<n:ValueConverterRelay x:Key="UrlValueConverterRelay" />
	</UserControl.Resources>
	
	<i:Interaction.Behaviors>
		<n:BridgeViewModelBehavior/>
	</i:Interaction.Behaviors>

	<Border x:Name="LayoutRoot" Padding="10,0,0,0">
		<Grid Background="{x:Null}" HorizontalAlignment="Left" Width="660">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="220"/>
				<ColumnDefinition Width="*"/>
				<ColumnDefinition Width="10"/>
			</Grid.ColumnDefinitions>
            
			<Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFC3C3C3" Height="1" Margin="6,30.664,7,0" 
				VerticalAlignment="Top" UseLayoutRounding="False" Data="M0,30 L587,30" StrokeDashOffset="39" 
				StrokeDashArray="2 2" Grid.ColumnSpan="1" d:IsLocked="True"/>
			<TextBlock Height="Auto" Margin="7,9,0,0" VerticalAlignment="Top" Text="Office® Options" 
				TextWrapping="NoWrap" FontFamily="Arial" FontSize="14" HorizontalAlignment="Left" FontWeight="Bold" d:IsLocked="True"/>
			<Grid Grid.Column="1">
				<!-- 
                    Can't use this because no item can be selected, hence the error unless we use a type converter 
                    CurrentUrl="{Binding Path=SelectedItem.Tag, ElementName=OptionsListBox}" -->
				<n:NavigationContainer x:Name="SettingsContainer"
					Style="{StaticResource OfficerContainerStyle}"
					HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Margin="0,0,0,45" 
					Url="Dialogs/SidePanels/CommonOptions"/>
				<Path Fill="#FFFFFFFF" Stretch="Fill" Stroke="#FFC3C3C3" Height="1" Margin="6,0,6,41.336" 
					VerticalAlignment="Bottom" UseLayoutRounding="False" Data="M0,30 L587,30" StrokeDashOffset="39" 
					StrokeDashArray="2 2" Grid.ColumnSpan="1" HorizontalAlignment="Left" Width="Auto"/>
			</Grid>
            
			<!-- SETTINGS CONTAINER RELATED -->
            
			<Border x:Name="SideShadow" Height="Auto" HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="10" 
				BorderBrush="Gainsboro" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5" BorderThickness="0,0,1,0">
				<Border.Background>
					<LinearGradientBrush EndPoint="0.848,0.712" StartPoint="0.161,0.712">
						<GradientStop Color="#FFE7ECF0" Offset="1"/>
						<GradientStop Color="#00E5E9EC"/>
					</LinearGradientBrush>
				</Border.Background>
			</Border>
            
			<!-- LIST BOX SELECTOR -->
			<ListBox BorderThickness="0,0,0,0" Padding="0,0,0,0" ScrollViewer.VerticalScrollBarVisibility="Disabled" 
				Margin="5,39,0,3" ItemContainerStyle="{StaticResource OptionsListBoxItemStyle}"
				Background="{x:Null}" HorizontalContentAlignment="Stretch" BorderBrush="{x:Null}" x:Name="OptionsListBox"
				SelectedIndex="0">
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="SelectionChanged">
						<n:NavigateAction Url="{Binding SelectedIndex, Converter={StaticResource UrlValueConverterRelay}, ElementName=OptionsListBox, Mode=OneWay}" HandlerName="SettingsContainer"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
                
				<Grid Height="36" Width="Auto" Cursor="Hand" Background="#00FFFFFF" 
					Tag="Dialogs/SidePanels/CommonOptions" HorizontalAlignment="Stretch">
					<TextBlock Height="Auto" HorizontalAlignment="Left" Margin="50,0,0,0" 
						FontFamily="Arial" FontSize="12" Text="Common Settings" TextWrapping="NoWrap" VerticalAlignment="Center"/>
					<Image HorizontalAlignment="Left" Width="32" Source="../Icons/Properties.png" Stretch="UniformToFill" 
						VerticalAlignment="Top" Margin="9,2,0,0" Height="32"/>
				</Grid>
                
				<Grid Height="36" Width="Auto" Cursor="Hand" Background="#00FFFFFF" Tag="Dialogs/SidePanels/AdvancedOptions">
					<TextBlock Height="Auto" HorizontalAlignment="Left" Margin="50,0,0,0" 
						FontFamily="Arial" FontSize="12" Text="Advanced Settings" TextWrapping="NoWrap" VerticalAlignment="Center"/>
					<Image HorizontalAlignment="Left" Width="32" Source="../Icons/Properties.png" Stretch="UniformToFill" 
						VerticalAlignment="Top" OpacityMask="{x:Null}" Margin="9,2,0,0" Height="32"/>
				</Grid>
                
			</ListBox>
            
			<!-- BOTTOM COMMANDS -->
			<Button Height="25" Margin="0,0,86,9" VerticalAlignment="Bottom" Content="Save" 
				Style="{StaticResource PrintButtonTemplate}" Grid.Column="1" Width="74" HorizontalAlignment="Right"
                    >
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<n:ExecuteCommandAction Command="{Binding SaveCommand}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>
			<Button Height="25" HorizontalAlignment="Right" Margin="0,0,6,9" VerticalAlignment="Bottom" Width="74" 
				Content="Cancel" Style="{StaticResource PrintButtonTemplate}" Grid.Column="1"
                    >
				<i:Interaction.Triggers>
					<i:EventTrigger EventName="Click">
						<n:ExecuteCommandAction Command="{Binding CancelCommand}"/>
					</i:EventTrigger>
				</i:Interaction.Triggers>
			</Button>
			<Path Stretch="Fill" HorizontalAlignment="Center" 
				Width="1" UseLayoutRounding="False" Data="M373,10 L373,656.02789" Grid.Column="2">
				<Path.Stroke>
					<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
						<GradientStop Color="Transparent"/>
						<GradientStop Color="Transparent" Offset="1"/>
						<GradientStop Color="#FFCDCDCD" Offset="0.95"/>
						<GradientStop Color="#FFCDCDCD" Offset="0.05"/>
					</LinearGradientBrush>
				</Path.Stroke>
			</Path>

		</Grid>
	</Border>
</UserControl>